﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="Hang.aspx.cs" Inherits="Banmaytinh.AdminSP.Hang" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">   
    
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="sanpham">
    <div id="FormName">QUẢN LÝ DANH MỤC LOẠI HÀNG</div>
    <asp:Panel ID="Panelview" runat="server" CssClass="panelview">
        <div class="control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="add" runat="server" ID="lbtnThem" 
                        onclick="lbtnThem_Click">Thêm mới</asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton CssClass="delete" runat="server" ID="lbtnXoa" 
                        onclick="lbtnXoa_Click" >Xóa</asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton CssClass="reload" runat="server" ID="lbLamlai">Làm mới</asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton CssClass="back" runat="server" ID="lbTrolai" >Trở lại</asp:LinkButton>
                </li>
            </ul>
        </div>
        <asp:GridView ID="grHang" runat="server" AllowSorting="True" AllowPaging="true" CssClass="mygrid"
            AutoGenerateColumns="False" PageSize="4" PagerStyle-CssClass="pagerstyle" 
            AlternatingRowStyle-CssClass="alt" 
            onselectedindexchanged="grHang_SelectedIndexChanged" 
            onrowcommand="grHang_RowCommand">
            
            <HeaderStyle  CssClass="trhead" />
            
            <Columns>
                 <asp:TemplateField ItemStyle-CssClass="tdCenter">
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="false" CssClass="chkHeader"/>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox  ID="chkSelect" runat="server"  CssClass="chkItem"/> 
                    </ItemTemplate>
                    <ItemStyle  CssClass="tdCenter"/>
                 </asp:TemplateField>
                <asp:BoundField  DataField="Tenhang" HeaderText="Tên hàng"/>
                 <asp:BoundField  DataField="Maloai" HeaderText="Loại hàng"/>
                 <asp:BoundField  DataField="Mahangsanxuat" HeaderText="Hãng sản xuất"/>
                 <asp:CheckBoxField DataField="Hienthi"  HeaderText="Hiển thị"/>
                 <asp:TemplateField>
                    <HeaderTemplate>Chức năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbSua" runat="server" CommandArgument='<%# Eval("Mahang") %>' CommandName="cmdEdit">Sửa</asp:LinkButton>
                        <asp:LinkButton ID="lbXoa" runat="server" CommandArgument='<%# Eval("Mahang") %>' CommandName="cmdDelete" OnClientClick="return confirm('Bạn có muốn xóa không?');">Xóa</asp:LinkButton>
                    </ItemTemplate>
                 </asp:TemplateField>
      
            </Columns>
        </asp:GridView>
        
    </asp:Panel>
    <asp:Panel ID="Paneledit" runat="server" Height="363px" 
    CssClass="paneledit" Visible="False">
        <table style="width: 100%; padding-top:50px; ">
            <tr>
                <td class="label">
                    Tên hàng:</td>
                <td width="250px" height="14px">
                  
                    <telerik:RadTextBox ID="txtTenhang" Runat="server" Width="200px">
                    </telerik:RadTextBox>
                </td>
                <td class="label">
                    Thời gian bảo hành:
                </td>
                <td width="250px" height="14px">
                    <telerik:RadTextBox ID="txtThoigianbaohanh" Runat="server" Width="200px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td class="label">
            
                    Loại hàng: </td>
                <td>
  
                    <telerik:RadComboBox ID="cboLoaihang" Runat="server" Width="200px">
                    </telerik:RadComboBox>
                </td>
                <td class="label">
                    Thứ tự hiển thị:
                </td>
                <td>
                    <telerik:RadTextBox ID="txtThutuhienthi" Runat="server" Width="200px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td class="label">
             
                    Hãng sản xuất:
                </td>
                <td>
           
                    <telerik:RadComboBox ID="cboHangsanxuat" Runat="server" Width="200px">
                    </telerik:RadComboBox>
                </td>
                <td class="label">
                
                   Tiêu đề:
                
                </td>
                <td>
                    <telerik:RadTextBox ID="txtTieude" Runat="server" Width="200px">
                    </telerik:RadTextBox>
               </td>
            </tr>
            <tr>
                <td class="label">
                    Kho hàng:
                </td>
                <td>
                    <telerik:RadComboBox ID="cboKhohang" Runat="server" Width="200px">
                    </telerik:RadComboBox>
                </td>
                <td class="label">
                    Từ khóa tìm kiếm:
                </td>
                <td>
                    <telerik:RadTextBox ID="txtTukhoatimkiem" Runat="server" Width="200px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Đơn vị tính:
                </td>
                <td>
                    <telerik:RadComboBox ID="cboDonvitinh" Runat="server" Width="200px">
                    </telerik:RadComboBox>
                </td>
                <td class="label">
                  Serial:
                </td>
                <td>
                    <telerik:RadTextBox ID="txtSerial" Runat="server" Width="200px">
                    </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td class="label">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td class="label">
                    Hiển thị:
                </td>
                <td>
                    <asp:CheckBox ID="chkHienthi" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="style2" colspan="4">
                    <asp:Panel ID="Panel1" runat="server" Height="90px">
                        <table style="width: 100%; height: 90px;">
                            <tr>
                                <td class="style3" rowspan="4">
                                    <asp:Image ID="imgAnh" runat="server" Height="79px" Width="164px" />
                                </td>
                                <td>
                                    <select id="cboTypeAnh" onchange="oncboTypeAnhchange()" onclick="return cboTypeAnh_onclick()">
                                        <option value="0">Ảnh trên mạng</option>
                                        <option value="1">Ảnh trên máy chủ</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div id="txtAnhbox">
                                        <telerik:RadTextBox ID="txtAnh" Runat="server" Width="300px">
                                        </telerik:RadTextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div id="Upload" style="width:54%" >
                                        <asp:Button  ID="btnBrowser"  runat="server" Text="Browser" CssClass="btnBrowser"
                                        OnClientClick="OpenFileExplorerDialog(); return false;" UseSubmitBehavior="false" CausesValidation="false"/>
                                        <script type="text/javascript">

                                            function OpenFileExplorerDialog() {
                                                var wnd = $find("<%= serverExplorer.ClientID %>");
                                                wnd.show();
                                            }

                                            function OnFileSelected(fileSelected) {
                                                var txtUrl = $find("<%= txtAnh.ClientID %>");
                                                txtUrl.set_value("~" + fileSelected);
                                            }

                                            function openUploader() {
                                                var imagePanel = document.getElementById("ImagePanel");
                                                var uploadPanel = document.getElementById("UploadPanel");
                                                imagePanel.style.display = 'none';
                                                uploadPanel.style.display = 'block';
                                            }

                                            function onUploadSubmit() {
                                                var imagePanel = document.getElementById("ImagePanel");
                                                var uploadPanel = document.getElementById("UploadPanel");
                                                uploadPanel.style.display = 'none';
                                                imagePanel.style.display = 'block';
                                            }

                                           
                                        </script>
                                        <asp:Button ID="btnUpload" runat="server" Text="Upload"  CssClass="btnUpload"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <telerik:RadEditor ID="txtMotasoluoc" runat="server" EditModes="Design" 
                        Height="200px" NewLineBr="False" NewLineMode="Div" TabIndex="10" Width="100%">
                        <Tools>
                            <telerik:EditorToolGroup Tag="MainToolbar">
                                <telerik:EditorTool Name="FindAndReplace" ShortCut="CTRL+F" />
                                <telerik:EditorTool Name="SelectAll" ShortCut="CTRL+A" />
                                <telerik:EditorTool Name="Cut" />
                                <telerik:EditorTool Name="Copy" ShortCut="CTRL+C" />
                                <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
                                <telerik:EditorSeparator />
                                <telerik:EditorSplitButton Name="Undo">
                                </telerik:EditorSplitButton>
                                <telerik:EditorSplitButton Name="Redo">
                                </telerik:EditorSplitButton>
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Superscript" />
                                <telerik:EditorTool Name="Subscript" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorSplitButton Name="ForeColor">
                                </telerik:EditorSplitButton>
                                <telerik:EditorSplitButton Name="BackColor">
                                </telerik:EditorSplitButton>
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorDropDown Name="Font chữ">
                                </telerik:EditorDropDown>
                                <telerik:EditorDropDown Name="Cỡ chữ">
                                </telerik:EditorDropDown>
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup Tag="DropdownToolbar">
                                <telerik:EditorSplitButton Name="InsertSymbol">
                                </telerik:EditorSplitButton>
                                <telerik:EditorToolStrip Name="InsertTable">
                                </telerik:EditorToolStrip>
                                <telerik:EditorSeparator />
                                <telerik:EditorTool Name="ConvertToLower" />
                                <telerik:EditorTool Name="ConvertToUpper" />
                            </telerik:EditorToolGroup>
                            <telerik:EditorToolGroup>
                                <telerik:EditorTool Name="Bold" ShortCut="CTRL+B" />
                                <telerik:EditorTool Name="Italic" ShortCut="CTRL+I" />
                                <telerik:EditorTool Name="Underline" ShortCut="CTRL+U" />
                                <telerik:EditorTool Name="StrikeThrough" />
                                <telerik:EditorSeparator />
                                <telerik:EditorTool Name="JustifyLeft" />
                                <telerik:EditorTool Name="JustifyCenter" />
                                <telerik:EditorTool Name="JustifyRight" />
                                <telerik:EditorTool Name="JustifyFull" />
                                <telerik:EditorTool Name="JustifyNone" />
                                <telerik:EditorSeparator />
                                <telerik:EditorTool Name="Indent" />
                                <telerik:EditorTool Name="Outdent" />
                                <telerik:EditorSeparator />
                                <telerik:EditorTool Name="InsertOrderedList" />
                                <telerik:EditorTool Name="InsertUnorderedList" />
                                <telerik:EditorSeparator />
                                <telerik:EditorTool Name="ToggleTableBorder" />
                            </telerik:EditorToolGroup>
                        </Tools>
                        <Content />
                    </telerik:RadEditor>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    <asp:Button ID="btnLuu" runat="server" Text="Cập nhật" onclick="btnLuu_Click" />
                </td>
                <td>
                    <asp:Button ID="btnHuy" runat="server" Text="Hủy bỏ" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">
                    <telerik:RadWindow ID="serverExplorer" runat="server" 
                        NavigateUrl="Explorer.aspx" Height="245px" Width="500px" 
                        Behaviors="Close, Move" Modal="True" ShowContentDuringLoad="False" 
                        VisibleStatusbar="False">
                    </telerik:RadWindow>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </asp:Panel>

</asp:Content>

